package demo4;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

/**
 * Author：毕龙
 * Date: 2024/5/15 20:07
 */
public class TestStringMethod1 {
    public static void main(String[] args) {
        String str = "雷小华穆龙龙王伟樊子枭郑泽豪";
        System.out.println(str.contains("王伟"));
        System.out.println(str.contains("带起"));
        char[] chars = str.toCharArray();
        System.out.println(Arrays.toString(chars));

        String yanzhengma = "abcdefghiklmnopqrstuvwxyz";
        yanzhengma += yanzhengma.toUpperCase();
        yanzhengma += "1234567890";
        String code = "";
        for (int i = 0; i < 4; i++) {
            code += yanzhengma.charAt(new Random().nextInt(yanzhengma.length()-1));
        }
        System.out.println(code);
        Scanner sc = new Scanner(System.in);
        String next = sc.next();
        //将输入的验证码和生成的验证码转化为小的的比较
        if(next.toLowerCase().equals(code.toLowerCase())){
            System.out.println("验证码输入成功");
        }else {
            System.out.println("验证码输入失败");
        }




    }
}
